package GUI;

import java.awt.Color;
import java.awt.event.ActionListener;

import javax.swing.JButton;

import javax.swing.JTextField;
import javax.swing.JLabel;

/**
 * The Class InsertProductDetailsGUI.
 * Boundary for inserting new product activity.
 */
public class InsertProductDetailsGUI extends AbstractPanelGUI {
	
	/** The button back. */
	private JButton btnBack;
	
	/** The button add. */
	private JButton btnAdd;
	
	/** The product name text field. */
	private JTextField productNameTf;
	
	/** The label aa. */
	private JLabel lblAa;
	
	/** The description text field. */
	private JTextField descriptionTf;
	
	/** The price text field. */
	private JTextField priceTf;
	
	/** The label price. */
	private JLabel lblPrice;
	
	/** The button choose picture. */
	private JButton btnChoosePicture;
	
	/** The label new label_1. */
	private JLabel lblNewLabel_1;
	/**
	 * Create the panel.
	 */
	public InsertProductDetailsGUI() {
		
		setBackground(Color.ORANGE);
		initialize();

	}
	
	/**
	 * initializes different properties of the panel and components.
	 */
	@Override
	public void initialize() {
		setLayout(null);
		setSize(Width,Height);
		
		btnAdd = new JButton("Add");
		btnAdd.setBounds(380, 304, 89, 23);
		add(btnAdd);
		
		btnBack = new JButton("Back");
		btnBack.setBounds(39, 304, 89, 23);
		add(btnBack);
		
		productNameTf = new JTextField();
		productNameTf.setBounds(146, 38, 160, 20);
		add(productNameTf);
		productNameTf.setDocument(new JTextFieldLimit(45));
		
		JLabel lblNewLabel = new JLabel("Product name:");
		lblNewLabel.setBounds(39, 41, 97, 14);
		add(lblNewLabel);
		
		lblAa = new JLabel("Description:");
		lblAa.setBounds(39, 92, 89, 14);
		add(lblAa);
		
		descriptionTf = new JTextField();
		descriptionTf.setBounds(146, 89, 323, 19);
		add(descriptionTf);
		descriptionTf.setDocument(new JTextFieldLimit(45));
		
		priceTf = new JTextField();
		priceTf.setBounds(146, 147, 86, 20);
		add(priceTf);
		priceTf.setDocument(new JTextFieldLimit(9));
		
		lblPrice = new JLabel("Price:");
		lblPrice.setBounds(39, 150, 67, 14);
		add(lblPrice);
		
		btnChoosePicture = new JButton("Choose picture");
		btnChoosePicture.setBounds(39, 178, 133, 23);
		add(btnChoosePicture);
		
		lblNewLabel_1 = new JLabel("Chosen picture directory:");
		lblNewLabel_1.setBounds(39, 212, 430, 14);
		add(lblNewLabel_1);

	}
	
	/**
	 * Gets the button back.
	 *
	 * @return the button back
	 */
	public JButton getBtnBack() {
		return btnBack;
	}
	
	/**
	 * Gets the button add.
	 *
	 * @return the button add
	 */
	public JButton getBtnAdd() {
		return btnAdd;
	}
	
	/**
	 * Gets the product name text field.
	 *
	 * @return the product name text field
	 */
	public JTextField getProductNameTf() {
		return productNameTf;
	}
	
	/**
	 * Gets the description text field.
	 *
	 * @return the description text field
	 */
	public JTextField getDescriptionTf() {
		return descriptionTf;
	}
	
	/**
	 * Gets the label new label_1.
	 *
	 * @return the label new label_1
	 */
	public JLabel getLblNewLabel_1() {
		return lblNewLabel_1;
	}
	
	/**
	 * Gets the price text field.
	 *
	 * @return the price text field
	 */
	public JTextField getPriceTf() {
		return priceTf;
	}
	
	/**
	 * Gets the button choose picture.
	 *
	 * @return the button choose picture
	 */
	public JButton getBtnChoosePicture() {
		return btnChoosePicture;
	}
	
	/**
	 * Adds action listener to back button.
	 *
	 * @param listener the listener
	 */
	public void addBackButtonActionListener(ActionListener listener)
	{
		btnBack.addActionListener(listener);
	}
	
	/**
	 * Adds action listener to add button.
	 *
	 * @param listener the listener
	 */
	public void addAddButtonActionListener(ActionListener listener)
	{
		btnAdd.addActionListener(listener);
	}
	
	/**
	 * Adds action listener to choose picture button.
	 *
	 * @param listener the listener
	 */
	public void addChoosePictureButtonListener(ActionListener listener)
	{
		btnChoosePicture.addActionListener(listener);
	}
}
